//路由懒加载
import loadable from 'react-loadable'

const loading = () => {
    return (
        <div>正在加载...</div>
    )
}

const routes = [
    {
            name: "home",
            path: "/home",
            component: loadable({ loader: () => import('../page/home/index'), loading }),
    },
    {
        name: "my",
        path: "/my",
        component: loadable({ loader: () => import('../page/my/index'), loading }),
    },
    {                                                                                                                                                                                                 
        name: "hunting",
        path: "/hunting",
        component: loadable({ loader: () => import('../page/hunting/index'), loading }),
    },
    {
        name: "house",
        path: "/house",
        component: loadable({ loader: () => import('../page/house/index'), loading }),
    },
    {
        name: "entire",
        path: "/entire",
        component: loadable({ loader: () => import('../page/entire/index'), loading }),
    },
    {
        name: "rent",
        path: "/rent",
        component: loadable({ loader: () => import('../page/rent/index'), loading }),
    },
    //轮播图
    {
        name: "swiper1",
        path: "/swiper1",
        component: loadable({ loader: () => import('../page/swiper1/index'), loading }),
    },{
        name: "swiper2",
        path: "/swiper2",
        component: loadable({ loader: () => import('../page/swiper2/index'), loading }),
    },{
        name: "swiper3",
        path: "/swiper3",
        component: loadable({ loader: () => import('../page/swiper3/index'), loading }),
    },
    //发布
    {
        name: "release",
        path: "/release",
        component: loadable({ loader: () => import('../page/release/index'), loading }),
    },
    //城市
    {
        name: "city",
        path: "/city",
        component: loadable({ loader: () => import('../page/city/index'), loading }),
    },
    {
        name:"login",
        path:"/login",
        component:loadable({loader:()=>import('../page/login/index'),loading})
    },
    {
        name:"detail",
        path:"/detail:id",
        component:loadable({loader:()=>import('../page/detail/index'),loading})
    },
    {
        name:"map",
        path:'/map',
        component:loadable({loader:()=>import('../page/map/index'),loading})
    }
]
               
export default routes                                                                                                                                                                                                                                                                                